<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>审核机构</title>
    <%@ include file="../../../common/meta.jsp" %>
    <%@ include file="../../../common/common-body.jsp" %>
    <link href="${ctx}/css/page/common-win.css?t=${now}" rel="stylesheet">
    <link href="${ctx}/css/plugins/note/note.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/common/myDateTimeFormat.js?t=${now}"></script>
    <script src="${ctx}/js/common/upLoadingFileSize.js?t=${now}"></script>
    <script src="${ctx}/js/plugins/jquery.ajaxfileupload-2.1.js?t=${now}"></script>
    <script src="${ctx}/js/plugins/note/note.js?t=${now}"></script>
    <script src="${ctx}/js/plugins/jQuery.md5.js?t=${now}"></script>
    <script src="${ctx}/js/imageview/jquery.photo.gallery.js?t=${now}"></script>
    <style>
        #_btnDiv{
            height: 34px;
            margin-bottom: 0px;
        }
        #_parentOrgDiv {
        <c:if test="${not empty oneAfterOrgInfo && oneAfterOrgInfo.orgRegion == 'branch'}">
            display: block;
        </c:if>
        <c:if test="${not empty oneAfterOrgInfo && oneAfterOrgInfo.orgRegion != 'branch'}">
            display: none;
        </c:if>
        }
    </style>
    <script>
        var defType = '${type}';
        var oneLogInfo = ${oneLogInfo};
        var searchLogInfo = ${searchLogInfo};
        var oneBeforeOrgInfo = ${oneBeforeOrgInfo};
        var oneAfterOrgInfo = ${oneAfterOrgInfo};
        var imgSrcDefault = "${ctx}/images/main/default.jpg";
    </script>
</head>
<body class="gray-bg">
<div>
    <div class="myContent">
        <div class="tabs-container">
            <div class="tab-content">
                <%--项目简介--%>
                <div id="tab-1" class="tab-pane active">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="ibox float-e-margins myIbox">
                                <div class="ibox-title">
                                    <h5>${operTypeStr}机构信息</h5>
                                </div>
                                <div class="ibox-content">
                                    <c:if test="${type == 'query'}">
                                        <form class="form-horizontal m-t">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">审核结果：</label>
                                                <label class="col-sm-8 control-label control-label-content">${not empty oneLogInfo && oneLogInfo.result == 'pass'? '通过' : '不通过'}</label>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">审核说明：</label>
                                                <label class="col-sm-8 control-label control-label-content">${not empty oneLogInfo?oneLogInfo.remark : ''}</label>
                                            </div>
                                        </form>
                                    </c:if>
                                    <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;基本信息</h5>
                                    <form class="form-horizontal m-t" id="_orgDataForm">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgCode != oneBeforeOrgInfo.orgCode) ? 'hasChange' : ''}">机构编码：</label>
                                            <label class="col-sm-8 control-label control-label-content">${not empty oneAfterOrgInfo?oneAfterOrgInfo.orgCode : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgName != oneBeforeOrgInfo.orgName) ? 'hasChange' : ''}"><span style="color: red">*</span>机构名称：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.orgName : ''}</label>
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgShortName != oneBeforeOrgInfo.orgShortName) ? 'hasChange' : ''}">机构简称：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.orgShortName : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgCategory != oneBeforeOrgInfo.orgCategory) ? 'hasChange' : ''}"><span style="color: red">*</span>机构类型：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.orgCategoryStr : ''}
                                                <c:forEach items="${orgCategoryMap}" var="item">
                                                    ${not empty oneAfterOrgInfo && oneAfterOrgInfo.orgCategory == item.code? item.name : '' }
                                                </c:forEach>
                                            </label>
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgLevel != oneBeforeOrgInfo.orgLevel) ? 'hasChange' : ''}"><span style="color: red">*</span>机构等级：</label>
                                            <label class="col-sm-3 control-label control-label-content">
                                                <c:forEach items="${orgLevelMap}" var="item">
                                                    ${not empty oneAfterOrgInfo && oneAfterOrgInfo.orgLevel == item.code? item.name : '' }
                                                </c:forEach>
                                            </label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgRegion != oneBeforeOrgInfo.orgRegion) ? 'hasChange' : ''}">主体关系：</label>
                                            <label class="col-sm-3 control-label control-label-content">
                                                <c:forEach items="${orgRegionMap}" var="item">
                                                    ${not empty oneAfterOrgInfo && oneAfterOrgInfo.orgRegion == item.key? item.value : '' }
                                                </c:forEach>
                                            </label>
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.code != oneBeforeOrgInfo.code) ? 'hasChange' : ''}">原机构编码：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.code : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <c:if test="${not empty oneAfterOrgInfo && oneAfterOrgInfo.orgRegion == 'branch'}">
                                                <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgParentCode != oneBeforeOrgInfo.orgParentCode) ? 'hasChange' : ''}">对应总部：</label>
                                                <label class="col-sm-8 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.orgParentCodeStr : ''}</label>
                                            </c:if>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.contactPhone != oneBeforeOrgInfo.contactPhone) ? 'hasChange' : ''}">联系电话：</label>
                                            <label class="col-sm-8 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.contactPhone : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgProvinceCode != oneBeforeOrgInfo.orgProvinceCode) ? 'hasChange' : ''}"><span style="color: red">*</span>省份：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.province : ''}</label>
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgCityCode != oneBeforeOrgInfo.orgCityCode) ? 'hasChange' : ''}"><span style="color: red">*</span>城市：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.city : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgAreaCode != oneBeforeOrgInfo.orgAreaCode) ? 'hasChange' : ''}">区/县：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.area : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgStreet != oneBeforeOrgInfo.orgStreet) ? 'hasChange' : ''}"><span style="color: red">*</span>详细地址：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.orgStreet : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.longitude != oneBeforeOrgInfo.longitude) ? 'hasChange' : ''}"><span style="color: red">*</span>经度：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.longitude : ''}</label>
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.latitude != oneBeforeOrgInfo.latitude) ? 'hasChange' : ''}"><span style="color: red">*</span>纬度：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.latitude : ''}</label>
                                        </div>
                                        <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;扩展信息</h5>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.isvPid != oneBeforeOrgInfo.isvPid) ? 'hasChange' : ''}"><span style="color: red">*</span>数据来源：</label>
                                            <label class="col-sm-3 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.isvName : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.searchTags != oneBeforeOrgInfo.searchTags) ? 'hasChange' : ''}">热门标签：</label>
                                            <label class="col-sm-8 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.searchTags : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgDescription != oneBeforeOrgInfo.orgDescription) ? 'hasChange' : ''}">机构介绍：</label>
                                            <label class="col-sm-8 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.orgDescription : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgLogo != oneBeforeOrgInfo.orgLogo) ? 'hasChange' : ''}">机构logo：</label>
                                            <div class="col-sm-8">
                                                <div  class="col-sm-2">
                                                    <div class="gallerys">
                                                        <img style="float: left"
                                                             class="img-rounded img-header gallery-pic"
                                                             onclick='$.openPhotoGallery(this)'
                                                             src="${not empty oneAfterOrgInfo.orgLogo && not empty oneAfterOrgInfo.orgLogo?oneAfterOrgInfo.orgLogo:ctx}${not empty oneAfterOrgInfo&&not empty oneAfterOrgInfo.orgLogo ?'':'/images/main/default.jpg'}">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgLogo != oneBeforeOrgInfo.orgLogo) ? 'hasChange' : ''}">logo链接：</label>
                                            <label class="col-sm-8 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.orgLogo : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgThumbnail != oneBeforeOrgInfo.orgThumbnail) ? 'hasChange' : ''}"><span style="color: red">*</span>机构缩略图：</label>
                                            <div class="col-sm-8">
                                                <div  class="col-sm-2">
                                                    <div class="gallerys">
                                                        <img style="float: left"
                                                             class="img-rounded img-header gallery-pic"
                                                             onclick='$.openPhotoGallery(this)'
                                                             src="${not empty oneAfterOrgInfo.orgThumbnail && not empty oneAfterOrgInfo.orgThumbnail?oneAfterOrgInfo.orgThumbnail:ctx}${not empty oneAfterOrgInfo&&not empty oneAfterOrgInfo.orgThumbnail ?'':'/images/main/default.jpg'}">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgThumbnail != oneBeforeOrgInfo.orgThumbnail) ? 'hasChange' : ''}">缩略图链接：</label>
                                            <label class="col-sm-8 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.orgThumbnail : ''}</label>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgImg != oneBeforeOrgInfo.orgImg) ? 'hasChange' : ''}">机构大图：</label>
                                            <div class="col-sm-8">
                                                <div  class="col-sm-2">
                                                    <div class="gallerys">
                                                        <img style="float: left"
                                                             class="img-rounded img-header gallery-pic"
                                                             onclick='$.openPhotoGallery(this)'
                                                             src="${not empty oneAfterOrgInfo.orgImg && not empty oneAfterOrgInfo.orgImg?oneAfterOrgInfo.orgImg:ctx}${not empty oneAfterOrgInfo&&not empty oneAfterOrgInfo.orgImg ?'':'/images/main/default.jpg'}">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label ${not empty oneAfterOrgInfo && not empty oneLogInfo && (oneLogInfo.operateType == 'edit' && oneAfterOrgInfo.orgImg != oneBeforeOrgInfo.orgImg) ? 'hasChange' : ''}">大图链接：</label>
                                            <label class="col-sm-8 control-label control-label-content">${not empty oneAfterOrgInfo ? oneAfterOrgInfo.orgImg : ''}</label>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <div class="form-group" id="_btnDiv">
                    <div class="col-sm-4 col-sm-offset-5">
                        <c:if test="${type == 'check'}">
                            <input type="button" class="btn btn-info" onclick="passOrg()" value="通过">
                            <input type="button" class="btn btn-danger" onclick="openCheckFailPage()" value="不通过">
                        </c:if>
                        <input type="button" class="btn btn-white" onclick="doClose()" value="返回">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="mergePage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 id="_modelTitle" style="text-align: center; font-weight: normal;">合并校验</h4>
            </div>
            <div class="modal-body modal-body-height">
                <label style="text-align: center; font-size: 16px;">系统检测到【<sqan id="_sOrgName"></sqan>】线上有疑似重复数据，是否选择与以下机构合并：</label>
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <table class='table table-striped table-hover'
                               id="publishOrgTable"
                               data-toggle="table"
                               data-pagination="false"
                               data-side-pagination="server"
                               data-striped="true"
                               data-response-handler="handleServerResult"
                               data-query-params-type="">
                            <thead>
                            <tr>
                                <th data-field="radio" data-radio="true"></th>
                                <th data-field="id" data-visible="false">主键id</th>
                                <th data-field="orgName" data-align="center">机构名称</th>
                                <th data-field="orgCode" data-align="center" data-width="120px">机构编码</th>
                                <th data-field="address" data-formatter="formatAddress" data-align="center" data-width="120px">机构所在地</th>
                                <th data-field="isvName" data-align="center" data-width="120px">服务商</th>
                            </tr>
                            </thead>
                        </table>
                        <label class="col-sm-12" style="text-align: center;"><sqan style="color: red;">注：选择不合并时，线上可能会出现多条重复数据，请谨慎操作。</sqan></label>
                    </div>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-info" onclick="doMergeOrg()">合并</button>
                <button class="btn btn-info" onclick="doNotMergeOrg()">不合并</button>
                <button class="btn btn-white" onclick="closeMergePage();">取消</button>
            </div>
        </div>
    </div>
</div>

<div id="checkFailPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 id="_modelTitle2" style="text-align: center; font-weight: normal;">审核不通过</h4>
            </div>
            <div class="modal-body modal-body-height">
                <form class="form-horizontal m-t">
                    <div class="form-group">
                        <label class="col-sm-12 control-label" style="text-align: left;"><span style="color: red">*</span>请输入审核不通过原因（必填）：</label>
                    </div>
                    <div class="form-group">
                        <textarea id="remark" name="remark" style="height: 120px; resize: none; width: 100%;" maxlength="1000"></textarea>
                    </div>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-primary" onclick="unPassOrg()">确定</button>
                <button class="btn btn-white" onclick="closeCheckFailPage();">取消</button>
            </div>
        </div>
    </div>
</div>

<script src="${ctx}/js/check/org/win/orgDataInfoMgr.js?t=${now}"></script>
</body>
</html>

